import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;


public class ClientSocket {

	Socket socket;
	//OutputStream out;
	//BufferedReader in;
	//ObjectInputStream in;
	//ObjectOutputStream out;
	//InputStream input ;
	BufferedInputStream in;
	BufferedOutputStream out;
	
	public void creationSocket(){
		
 
        try {
         
            socket = new Socket(InetAddress.getLocalHost(),2009);   
            //out = new ObjectOutputStream(socket.getOutputStream());
            //in = new ObjectInputStream(socket.getInputStream());
                //String message_distant = in.readLine();
                //System.out.println(message_distant);
            /*POUR TEST
            
            out = new PrintWriter(socket.getOutputStream()); */
            out = new BufferedOutputStream(socket.getOutputStream());   
            in = new BufferedInputStream (socket.getInputStream());
            //InputStream input = socket.getInputStream();
            
        }catch (UnknownHostException e) {
             
            e.printStackTrace();
        }catch (IOException e) {
             
            e.printStackTrace();
        }
    }
	
	public void fermetureSocket() throws IOException{
		 socket.close();
	}
	}

